<template>
  <div class="Serve container">
    <van-nav-bar title="联系客服" left-arrow @click-left="$router.back()" />
    <div class="banner">
      <img :src="banner" />
    </div>
    <div class="tablist">
      <h3>猜你想问</h3>
      <van-tabs v-model="active" animated>
        <van-tab :title="v.name" v-for="(v) in problemList" :key="v.id">
          <van-cell-group inset>
            <div class="tabitem" v-for="v2 in v.children" :key="v2.id">
              <span>{{v2.name}}</span>
              <van-icon name="arrow" />
            </div>
          </van-cell-group>
        </van-tab>
      </van-tabs>
    </div>
    <van-button type="info" block color="#f96c2f">去反馈</van-button>
  </div>
</template>

<script>
import { ServeData } from '@/api/api.js'
export default {
  name: 'YscShopServe',

  data () {
    return {
      active: 0,
      banner: '',
      problemList: []
    };
  },
  async created () {
    const { data: res } = await ServeData()
    this.banner = res.banner
    this.problemList = res.data
  },
  mounted () {

  },

  methods: {

  },
};
</script>

<style lang="less" scoped>
.Serve {
  background-color: #fff;
  .banner {
    width: 100%;
    height: 130px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  h3 {
    line-height: 30px;
    font-size: 16px;
    font-weight: bold;
    padding-left: 20px;
  }
  .van-cell-group {
    margin-top: 10px;
    background-color: #fafbfb;
    .tabitem {
      line-height: 40px;
      font-size: 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0px 20px;
      border-bottom: 0.5px solid #ddd;
    }
  }
  .van-button {
    position: fixed;
    bottom: 0px;
  }
}
</style>